<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\model\api;

use laytp\BaseModel;

class PeaceLike extends BaseModel
{
    public function record()
    {
        return $this->belongsTo(PeaceRecord::class,'record_id');
    }

    /**
     * 点赞列表
     * @param $openid
     * @return mixed
     */
    public function getLike($openid){
        if(empty($openid)){
            return [];
        }
        $list = $this->where([
                ['openid', '=', $openid],
            ])
            ->order('record_id desc')
            ->column('record_id');

        return $list;
    }
}